﻿//Copyright 2010 http://tv4home.codeplex.com
//This file is part of TV4Home.Client.TVViewer.
//TV4Home.Client.TVViewer is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
//TV4Home.Client.TVViewer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//You should have received a copy of the GNU Lesser General Public License along with TV4Home.Client.TVViewer. If not, see http://www.gnu.org/licenses/.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace TV4Home.Client.Desktop.TVViewer.Windows
{
    /// <summary>
    /// Interaction logic for Fullscreen.xaml
    /// </summary>
    public partial class Fullscreen : Window
    {
        public Controls.MediaPlayer MediaPlayerElement { get;private set; }
   
        public Fullscreen()
        {
            InitializeComponent();
        }
        public Fullscreen(Controls.MediaPlayer player)
        {
            MediaPlayerElement = player;
            InitializeComponent();
            ContentGrid.Children.Add(MediaPlayerElement); ;
        }

        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                ContentGrid.Children.Remove(MediaPlayerElement);
                DialogResult = true;
                this.Close();
            }
            
        }
        public TimeSpan Position
        {
            get 
            {
                return MediaPlayerElement.Position;
            }
            set 
            {

                MediaPlayerElement.Position = value;
            }
        
        }
    }
}
